//package com.wbk.lotterysystemgateway.filter;
//
//import com.coolgua.common.bean.ApiResult;
//import io.micrometer.core.instrument.util.JsonUtils;
//import org.apache.commons.codec.CharEncoding;
//import org.springframework.http.HttpStatus;
//
//import javax.servlet.ServletOutputStream;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//
///*******************************************************************************
// * @project: ganlee
// * @package: com.coolgua.common.util
// * @author: wulizhou
// * @created: 2020/11/13
// * @purpose:
// *
// * Copyright 2020 coolgua.com All rights reserved.
// ******************************************************************************/
//public class HttpResponseUtil {
//
//    public static <T> void send(HttpServletResponse response, ApiResult<T> result, HttpStatus status) throws IOException {
//        response.setCharacterEncoding(CharEncoding.UTF_8);
//        response.setContentType("applcation/json; charset=utf-8");
//        response.setStatus(status.value());
//        try (ServletOutputStream os = response.getOutputStream()) {
//            os.write(JsonUtils.obj2Json(result).getBytes(CharEncoding.UTF_8));
//            os.flush();
//        }
//    }
//
//    public static <T> void send(HttpServletResponse response, ApiResult<T> result) throws IOException {
//        send(response, result, HttpStatus.OK);
//    }
//
//}
